//package minijava;

//import System.IO.StreamReader;

//import java_cup.runtime.ComplexSymbolFactory;
//import minijava.Program;
//import miniparser.*;

public class InMemoryParser {
    public System.IO.StreamReader @in;
    public InMemoryParser(System.IO.StreamReader @in) {
        this.@in = @in;
    }
    public Program parse() {
        Lexer scanner = null;
        ComplexSymbolFactory csf = new ComplexSymbolFactory();
        scanner = new Lexer(@in, csf);
        Parser p = new Parser(scanner, csf);
        return (Program)p.parse().value;
    }
}
